﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Home/Home.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="Heritage.Codebox" %>
<%@ Import Namespace="Heritage.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

<div class="mainname" style="margin-bottom:10px;">
    <div style="float:left;padding-top:12px;"><span class="FreeSetBold" style="padding-left: 30px; padding-bottom: 0px; margin-top:0px; color:#0E1A21; font-size:20px">Активные игры</span></div>
</div>
   <% 
   IEnumerable<Heritage.Games> list = Utils.GetActiveGames();
   if (list.Count() == 0)
   { %>
   <p style="font-size:12px;">Активных игр нет</p>
       <% }
   else
   {
       foreach (Heritage.Games g in list)
       {  %>
       <div class="gamename"><%=g.GameName%></div>
       <div class="gamedesc">
       <div style="display:table-row">
       <div style="display:table-cell; width:100%; padding-right:16px;"><b><%=Utils.GetGameConditions(g)%></b><br /><i><%=g.GameDescription%></i></div>
       <div class="g_links"><b><%=GameSchedule.FromGameString(g.GameSchedule).Description(true)%>
       <% if (g.GameState == Constants.GAME_STATE_IN_PROGRESS)
{%>
       <br /><br /><span style="font-weight:normal; font-style:italic"><%=GameSchedule.FromGameString(g.GameSchedule).NextTurnString()%></span>
       <%
}%>
       </b></div>
       <div class="g_links">       
       <% if (g.GameState == Constants.GAME_STATE_IN_PROGRESS)
          { %><a href="/Game/View/<%=g.GameName %>">день <%=g.GameTurn%></a><%} %>
       <% if (g.GameState == Constants.GAME_STATE_STOPPED)
          { %><a href="/Game/View/<%=g.GameName %>">остановлена на <%=g.GameTurn%> ходу</a><%} %>
       <% if (g.GameState == Constants.GAME_STATE_FINISHED)
          { %><a href="/Game/View/<%=g.GameName %>">завершена на <%=g.GameTurn%> ходу</a><%} %>
       </div>
       <% string z = Utils.GetLinks(g);
          if (z.Trim().Length > 0)
          {%>
       <div class="g_links"><%=z%></div>
       <% } %>
       </div>
       </div>
       <br />
   <% }
   } %>
</asp:Content>
